{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox-title">
        <h5>运费计算</h5>
    </div>
    <div class="ibox-title">
        <h5>价格</h5><span style="padding-left:10px;font-size:16px" class="price"></span>
    </div>
    <div class="ibox-content layui-form">
        <div class="layui-row layui-col-space10 layui-form-item ">
            <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                <label class="layui-form-label">出发地：</label>
                <div class="layui-input-block">
                    <input type="text" name="go_address" maxlength="8"  lay-verify="required" placeholder="出发地" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                <label class="layui-form-label">目的地：</label>
                <div class="layui-input-block">
                    <input type="text" name="to_address" maxlength="8"  lay-verify="required" placeholder="目的地" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                <label class="layui-form-label">车长：</label>
                <div class="layui-input-block">
                    <select name="cc">
                        {volist name="list" id="vo"}
                         <option value="{$vo['cclb_name']}" >{$vo['cclb_name']}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="component-form-element">计算
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form'], function() {
        var form = layui.form;

        form.on('submit(component-form-element)', function (data) {
//            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('index')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                $(".price").html(res.msg);
                }
            })
        });
    });
</script>
</body>
</html>